#[derive(Debug)]
enum HotpotItem {
    Meat(String),
    Vegetable(String),
    Drink(u32), // 毫升数
}

fn main() {
    // 创建火锅订单
    let mut order = Vec::new();

    // 添加食材（不同枚举类型）
    order.push(HotpotItem::Meat(String::from("毛肚")));
    order.push(HotpotItem::Vegetable(String::from("娃娃菜")));
    order.push(HotpotItem::Drink(500));

    // 安全检查第三样菜品
    match order.get(2) {
        Some(HotpotItem::Drink(ml)) => println!("发现饮品：{}ml", ml),
        _ => println!("这个位置不是饮品"),
    }

    // 遍历升级订单
    for item in &mut order {
        match item {
            HotpotItem::Meat(name) => *name = format!("特级{}", name),
            HotpotItem::Drink(ml) => *ml += 100, // 免费升级大杯
            _ => {}
        }
    }

    // 移除最后一项
    let removed = order.pop();
    println!("已移除：{:?}", removed);

    // 展示最终订单
    println!("\n====== 您的火锅套餐 ======");
    for (index, item) in order.iter().enumerate() {
        match item {
            HotpotItem::Meat(name) => println!("{}号菜品：{}", index + 1, name),
            HotpotItem::Vegetable(name) => println!("{}号菜品：{}", index + 1, name),
            HotpotItem::Drink(ml) => println!("{}号饮品：{}ml", index + 1, ml),
        }
    }
}